{extend name="common/dialog" /}
{block name="head"}
<link rel="stylesheet" href="__STATIC__/common/css/jquery-ui.css" media="all">
<script type="text/javascript" src="__STATIC__/common/js/jquery-ui.js"></script>
<style type="text/css">
    @media screen and (min-width: 768px){
      .layui-container {
          width: 95%;
      }
    }
    .body-back{background-color: #fff;}
</style>
{/block}
{block name="main"}
<div class="layui-container" style="padding: 0;">
  <div class="layui-btn-group tab-btn tab-view-btns" style="float: right;">
    <button class="layui-btn tab-active" data-id="#view-tab-1">{:lang('Basic Information')}</button>
    <button class="layui-btn" data-id="#view-tab-2" >{:lang('Line Configuration')}</button>
    <?php if($adminType == 1 || $adminType == 5):?>
    <button class="layui-btn" data-id="#view-tab-4">{:lang('Docking information')}</button>
    <?php endif;?>
    <?php if($adminType == 1 || $adminType == 4):?>
    <button class="layui-btn" data-id="#view-tab-5">{:lang('Distribution Engineer')}</button>
    <?php endif;?>
    <?php if($row['status'] == 2 || $row['status'] == 8):?>
    <button class="layui-btn" id="_reloadchart" data-id="#view-tab-6" data-href="{:url('ajax/getUsage',['network_id'=>$row['id']])}">{:lang('Usage')}</button>
    <?php endif;?>
    <?php if(!empty($user)):?>
    <button class="layui-btn " data-id="#view-tab-3">{:lang('User information')}</button>
    <?php endif;?>
  </div>
  <div style="clear:both"></div>
  <div class="view-content" style="margin:15px 0;">
      <div class="layui-row" style="position: relative;">
        <div class="layui-col-xs6" style="padding-right:35px;">
          <div class="grid-demo grid-demo-bg1" >
             <div class="view-content-border border-shadow">
               <div class="layui-row">
                <div class="layui-col-xs2">
                  <?php if($row['type'] == 3):?>
                  <i class="icon icon-onedrive i-black" ></i>
                  <?php else:?>
                  <i class="icon icon-earth i-black"></i>
                  <?php endif?>
                 
                </div>
                <div class="layui-col-xs10">
                  <div><b>{$row['locallabel']}</b></div>
                  <div style="">{$row['locatlabeladdress']} </div>
                </div>
               </div>
             </div>
          </div>
          
        </div>
        <div class="layui-col-xs6" style="padding-left: 35px;">
          <div class="view-content-border border-shadow">
            <div class="layui-row">
                <div class="layui-col-xs2">
                 <?php if($row['endtype'] == 3):?>
                  <i class="icon icon-onedrive i-black" ></i>
                  <?php else:?>
                  <i class="icon icon-earth i-black"></i>
                  <?php endif?>
                </div>
                <div class="layui-col-xs10">
                  <div><b>{$row['endclou']}</b></div>
                  <div style="">{$row['endlabeladdress']}</div>
                </div>
               </div>
          </div>
           
        </div>
        </div>
        <span class="lricon-ler" >
        </span>
      </div>
        <!--中间-->
        <div class="view-tab" id="view-tab-1">
           <!--左边-->
           <div class="layui-col-xs6" style="padding: 0 15px;">
              <!--form-->
              <div>
                <div class="form-item">
                  <div class="form-label">{:lang('Customer No.')}</div>
                  <div class="form-value" style="position: relative;">
                    <input type="" id="_sn"  name="sn" class='' value="{$row['sn']|default="--"}" title="" >
                    <?php if($adminType == 4 || $adminType == 1):?>
                    <button type="button" class="layui-btn layui-btn-primary input-upload-btn _layer-dialog" data-size="['550px','350px']" data-title="{:lang('Resetting the contract number')}" id="_resetsn" data-href="{:url('resetsn',['network_id'=>$row['id']])}" style="top:4px;"><i class="icon icon-pencil2"></i></button>

<!--                     <button type="button" class="layui-btn layui-btn-primary" data-href="{:url('resetsn',['network_id'=>$row['id']])}" id="_resetsn" ><i class="icon icon-pencil2"></i></button>
 -->                    <?php endif;?>
                  </div>
                </div>
                <div class="form-item">
                  <div class="form-label">{:lang('Network Name')}</div>
                  <div class="form-value"><input type="" name="" disabled="" value="{$row['name']}"></div>
                </div>
                
                <?php if(!empty($row['plan_time'])):?>
                <div class="form-item">
                  <div class="form-label">{:lang('Planned opening time')}</div>
                  <div class="form-value"><input type=""   disabled="" value="{$row['plan_time']}"> </div>
                </div>
                <?php endif;?>
                <div class="form-item">
                  <div class="form-label">{:lang('Expire Date')}</div>
                  <div class="form-value">
                    <input type="" name="appro_time" id="_approtime" title="{$adminType == 4 ? lang('Double Click Edit') :''}" data-type="{$adminType == 4 ? 1 :0}" class='datetime-icon display-input _noajax' data-url="{:U('ajax/updateField',['nework_id'=>$row['id']])}" disabled value="{$row['approtime']|default="--"}" style="width:215px"> <span style="color:#212121;">-</span>

                    <input type="" name="enddate" id="_enddate" title="{$adminType == 4 ? lang('Double Click Edit') :''}" style="width:calc(100% - 230px)" data-type="{$adminType == 4 ? 1 :0}" class='datetime-icon display-input _noajax' data-url="{:U('ajax/updateField',['nework_id'=>$row['id']])}" disabled value="{$row['enddate']|default="--"}">
                  </div>
                </div>
                <!--是否为客户-->
                <?php if($adminType != 1000):?>
                 <div class="form-item">
                  <div class="form-label">{:lang('Purchase Time')} <span style="color: #212121;float: right;padding-right: 20px;">(Month)</span></div>
                  <div class="form-value">
                    <input type=""   disabled="" value="{$row['daylength']}"> 
                  </div>
                </div>
                <?php endif;?>
                <div class="form-item">
                  <div class="form-label">{:lang('Status')}</div>
                  <div class="form-value">
                  <?php if($adminType == 4):?>
                  
                  <select name="status" lay-filter="_status" id="_status" class="display-change">
                    <option value="{$row['status']}" selected disabled="">{$statuslist[$row['status']]}</option>
                    <?php foreach($statuslist as $in=>$status):?>
                    <?php if(($in == 15 || $in==16) && $in != $row['status']):?>
                    <option value="{$in}" >{$status}</option>
                    <?php endif;?>
                    <?php endforeach;?>
                  </select>
                  <?php else:?>
                  <input type="" name="" disabled="" value="{$row['statuslabel']}"> 
                  <?php endif;?>
                  </div>
                </div>
                <div class="form-item">
                    <div class="form-label">{:lang('remarks')}</div>
                    <div class="form-value"><input type="" name="" disabled="" value="{$row['remarks']|default='--'}"> <span style="color:#888;"></span></div>
                  </div>
              </div>
              <!--form end-->
           </div>
           <!--左边结束-->
           <!--右边-->
           <div class="layui-col-xs6" style="padding-left: 50px;">
             <!--form-->
              <div>
                  <?php if($adminType == 4 || $adminType == 1):?> 
                  <div class="form-item">
                    <div class="form-label">{:lang('Media')}：</div>
                    <div class="form-value" style="position: relative;">
                      <input type="text" name="media" placeholder="" value="{$row['media']}" style="" lay-verify="required" id="_media" readonly="" >
                      <button type="button" class="layui-btn layui-btn-primary input-upload-btn" id="_mediaBtn" data-href="{:url('resetsn',['network_id'=>$row['id']])}" style="top:4px;"><i class="icon icon-upload3"></i></button>

<!--                       <button type="button" class="layui-btn layui-btn-primary" id="_mediaBtn" style="position: absolute;right: -4px;top:0px;height: 32px;line-height: 32px;"><i class="icon icon-upload3"></i>{:lang('Upload Image')}</button>
 -->                      
                      <span style="color:#888;"></span>
                  </div>
                  <p id="_media_view"><img src="{$row['media']|default='/static/admin/images/logo2x.png'} " id="_image-full" class="view-img0" style="" /></p>
                </div>
                  <?php else:?>
                  <div class="form-item">
                      <div class="form-value">
                      <img src="{$row['media']|default='/static/admin/images/logo2x.png'}" id="_image-full" class="view-img0" />
                      </div>
                   </div>
                  <?php endif;?>
              </div>
              <!--form end-->
           </div>
           <!--右边结束-->
        </div>
        <div class="view-tab" id="view-tab-2" style="display: none">
            <!--左边-->
            <div class="layui-col-xs6" style="padding-right: 25px;">
                 <div class="form-item">
                    <div class="form-label">{:lang('End Network')}</div>
                    <div class="form-value">
                      <input type="" name="local_network"   title="{$adminType == 5 ? lang('Double Click Edit') :''}" data-type="{$adminType == 5 ? 1 :0}" class='display-input' data-url="{:U('ajax/updateField',['nework_id'=>$row['id']])}" disabled value="{$row['local_network']|default="--"}">
                    </div>
                  </div>
                  <!--云端-->
                  <?php if($row['type'] == 3):?>
                    <div class="form-item">
                      <div class="form-label">{:lang('Data Center')}</div>
                      <div class="form-value">
                        <input type="" name=""  disabled="" value="{$row['cloud_conter']|getDataCenter}">
                      </div>
                    </div>
                    <!--google cloud-->
                    <?php if($row['local_cloud_id'] == 3739):?>
                      <div class="form-item">
                        <div class="form-label">
                          {:lang('Pairing key')}：
                        </div>
                        <div class="form-value">
                            <input type="" name=""  disabled="" value="{$row['AauthKey']} ">
                          </div>
                      </div>
                    <!--Azure cloud-->
                    <?php elseif($row['local_cloud_id'] == 3738):?>
                      <div class="form-item">
                        <div class="form-label">
                          {:lang('Service Key')}：
                        </div>
                        <div class="form-value">
                            <input type="" name=""  disabled="" value="{$row['AauthKey']} ">
                          </div>
                      </div>
                      <!--aws cloud-->
                    <?php elseif($row['local_cloud_id'] == 3737):?>
                      <div class="form-item">
                        <div class="form-label">
                          {:lang('Account ID')}：
                        </div>
                        <div class="form-value">
                            <input type="" name=""  disabled="" value="{$row['local_cloud_userid']} ">
                          </div>
                      </div>
                      <!--华为云-->
                    <?php elseif($row['local_cloud_id'] == 3742):?>
                      <div class="form-item">
                        <div class="form-label">
                          {:lang('Account ID')}：
                        </div>
                        <div class="form-value">
                            <input type="" name=""  disabled="" value="{$row['local_cloud_userid']} ">
                          </div>
                      </div>
                      <div class="form-item">
                        <div class="form-label">{:lang('Order ON.')}</div>
                        <div class="form-value">
                          <input type="" name=""  disabled="" value="{$row['orderId1']}">
                        </div>
                      </div>
                      <div class="form-item">
                        <div class="form-label">{:lang('VPC ID')}</div>
                        <div class="form-value">
                          <input type="" name=""  disabled="" value="{$row['VPCID1']}">
                        </div>
                      </div>
                      <div class="form-item">
                        <div class="form-label">{:lang('VPC')}</div>
                        <div class="form-value">
                          <input type="" name=""  disabled="" value="{$row['VPC1']}">
                        </div>
                      </div>
                    <!--其他云-->
                    <?php else:?>
                      <div class="form-item">
                        <div class="form-label">
                          {:lang('Account ID')}：
                        </div>
                        <div class="form-value">
                            <input type="" name=""  disabled="" value="{$row['local_cloud_userid']} ">
                          </div>
                      </div>
                    <?php endif;?>
                  <?php endif;?>
                  <!--云端 end-->
            </div>
            <div class="layui-col-xs6" style="padding-left: 50px;">
               <div class="form-item">
                    <div class="form-label">{:lang('End-to-end Network')}</div>
                    <div class="form-value">
                      <input type="" name="end_network" title="{$adminType == 5 ? lang('Double Click Edit') :''}"  data-type="{$adminType == 5 ? 1 :0}" class='display-input' data-url="{:U('ajax/updateField',['nework_id'=>$row['id']])}" disabled value="{$row['end_network']|default="--"}">
                    </div>
                  </div>
                <!--云端-->
                <?php if($row['endtype'] == 3):?>
                    <div class="form-item">
                      <div class="form-label">{:lang('Data Center')}</div>
                      <div class="form-value">
                        <input type="" name=""  disabled="" value="{$row['ecloud_conter']|getDataCenter}">
                      </div>
                    </div>
                    <!--google cloud-->
                    <?php if($row['endcloudid'] == 3739):?>
                      <div class="form-item">
                        <div class="form-label">
                          {:lang('Pairing key')}：
                        </div>
                        <div class="form-value">
                            <input type="" name=""  disabled="" value="{$row['ZauthKey']} ">
                          </div>
                      </div>
                    <!--Azure cloud-->
                    <?php elseif($row['endcloudid'] == 3738):?>
                      <div class="form-item">
                        <div class="form-label">
                          {:lang('Service Key')}：
                        </div>
                        <div class="form-value">
                            <input type="" name=""  disabled="" value="{$row['ZauthKey']} ">
                          </div>
                      </div>
                      <!--aws cloud-->
                    <?php elseif($row['endcloudid'] == 3737):?>
                      <div class="form-item">
                        <div class="form-label">
                          {:lang('Account ID')}：
                        </div>
                        <div class="form-value">
                            <input type="" name=""  disabled="" value="{$row['end_userid']} ">
                          </div>
                      </div>
                      <!--华为云-->
                    <?php elseif($row['endcloudid'] == 3742):?>
                      <div class="form-item">
                        <div class="form-label">
                          {:lang('Account ID')}：
                        </div>
                        <div class="form-value">
                            <input type="" name=""  disabled="" value="{$row['end_userid']} ">
                          </div>
                      </div>
                      <div class="form-item">
                          <div class="form-label">{:lang('Order ON.')}</div>
                          <div class="form-value">
                            <input type="" name=""  disabled="" value="{$row['orderId2']}">
                          </div>
                        </div>
                        <div class="form-item">
                          <div class="form-label">{:lang('VPC ID')}</div>
                          <div class="form-value">
                            <input type="" name=""  disabled="" value="{$row['VPCID2']}">
                          </div>
                        </div>
                        <div class="form-item">
                          <div class="form-label">{:lang('VPC')}</div>
                          <div class="form-value">
                            <input type="" name=""  disabled="" value="{$row['VPC2']}">
                          </div>
                        </div>
                    <!--其他云-->
                    <?php else:?>
                      <div class="form-item">
                        <div class="form-label">
                          {:lang('Account ID')}：
                        </div>
                        <div class="form-value">
                            <input type="" name=""  disabled="" value="{$row['end_userid']} ">
                          </div>
                      </div>
                    <?php endif;?>
                    
                <?php endif;?>
            </div>
        </div>
        <!--用户信息-->
        <?php if(!empty($user)):?>
        <div class="view-tab" id="view-tab-3" style="display: none">
            <!--left-->
            <div class="layui-col-xs6" style="padding-right: 25px;">
                <div class="form-item">
                  <div class="form-label">{:lang('User Mailbox')}</div>
                  <div class="form-value">
                    <input type="" name=""  disabled="" value="{$user['email']}">
                  </div>
                </div>
                <div class="form-item">
                  <div class="form-label">{:lang('User Ownership')}</div>
                  <div class="form-value">
                    <input type="" name=""  disabled="" value="{$user['sup_id']|getSupNameGroup}">
                  </div>
                </div>
                <div class="form-item">
                  <div class="form-label">{:lang('tel')}</div>
                  <div class="form-value">
                    <input type="" name=""  disabled="" value="{$row['tel']|default="--"}">
                  </div>
                </div>
                <div class="form-item">
                  <div class="form-label">{:lang('Telephone')}</div>
                  <div class="form-value">
                    <input type="" name=""  disabled="" value="{$user['Telephone']|default="--"}">
                  </div>
                </div>
                <div class="form-item">
                  <div class="form-label">{:lang('Company Name')}</div>
                  <div class="form-value">
                    <input type="" name=""  disabled="" value="{$user['company']|default="--"}">
                  </div>
                </div>
                <div class="form-item">
                  <div class="form-label">{:lang('Company Address')}</div>
                  <div class="form-value">
                    <input type="" name=""  disabled="" value="{$user['address']|default="--"}">
                  </div>
                </div>

            </div>
            <!--left end-->
            <!--rigth-->
            <div class="layui-col-xs6" style="padding-left: 50px;">
            </div>
            <!--rigth end-->
        </div>
        <?php endif;?>
        <!--用户信息 end-->
        <!--Usage-->
        <div class="view-tab" id="view-tab-6" style="display: none">
          <form class="layui-form" id="_form6" action="">
              <div id="_main" style="width: 1050px;height:400px;"></div>
              <div class="form-item">
                <label class="form-label" >{:lang('Date Range')}:</label>
                  <div class="form-value" style="width: 250px">
                    <select name="hours" id="_hours" lay-filter="_hours">
                      <option value="12">{:lang('Last 12 Hours')}</option>
                      <option value="24">{:lang('Last 24 Hours')}</option>
                      <option value="168">{:lang('Last 7 Days')}</option>
                    </select>
                  </div>
              </div>
          </form>
        </div>
        <!--end Usage-->
        <!--对接信息-->
        <?php if($adminType == 1 || $adminType == 5):?>
        <div class="view-tab" id="view-tab-4" style="display: none">
          <form id="_form2" action="{:U('saveConfig')}">
            <input name="network_id" type="hidden" value="{$row['id']}" />
            <!--left-->
            <div class="layui-col-xs6" style="padding-right: 25px;">
                <div class="form-item">
                  <div class="form-label">{:lang('Cloud end butt')}</div>
                  <div class="form-value">
                  </div>
                </div>
                <div class="form-item">
                  <div class="form-label">{:lang('Vlan (Outer)')}</div>
                  <div class="form-value">
                    <input type="text" name="vlan_cloud" class="edit-icon" placeholder="" value="{$config['vlan_cloud']}" />
                  </div>
                </div>
                <div class="form-item">
                  <div class="form-label">{:lang('Vlan (Inner)')}</div>
                  <div class="form-value">
                    <input type="text" name="vlan_cloud_inner" class="edit-icon" placeholder="" value="{$config['vlan_cloud_inner']}" />
                  </div>
                </div>
                <div class="form-item">
                  <div class="form-label">{:lang('Backbone Boundary IP')}</div>
                  <div class="form-value">
                    <input type="text" value="{$config['backboundary_ip']}" name="backboundary_ip" class="edit-icon" placeholder="0.0.0.0/0" />
                  </div>
                </div>
                <div class="form-item">
                  <div class="form-label">{:lang('Cloud Boundary IP')}</div>
                  <div class="form-value">
                    <input type="text" value="{$config['boundary_ip']}"  name="boundary_ip" class="edit-icon" placeholder="0.0.0.0/0"/>
                  </div>
                </div>
                <div class="form-item">
                  <div class="form-label">{:lang('Backbone ASN')}</div>
                  <div class="form-value">
                    <input type="text" value="{$config['back_asn']}" name="back_asn" class="edit-icon" placeholder=""/>
                  </div>
                </div>
                <div class="form-item">
                  <div class="form-label">{:lang('Cloud ASN')}</div>
                  <div class="form-value">
                    <input value="{$config['cloud_asn']}" name="cloud_asn" type="text" class="edit-icon" placeholder=""/>
                  </div>
                </div>
            </div>
            <!--left end-->
            <!--rigth-->
            <div class="layui-col-xs6" style="padding-left: 50px;">
               <div class="form-item">
                  <div class="form-label">{:lang('Client docking')}</div>
                  <div class="form-value">
                  </div>
                </div>
               <div class="form-item">
                  <div class="form-label">{:lang('Vlan (Outer)')}</div>
                  <div class="form-value">
                    <input type="text" value="{$config['vlan_idc']}" name="vlan_idc" class="edit-icon" placeholder=""/>
                  </div>
                </div>
                <div class="form-item">
                  <div class="form-label">{:lang('Vlan (Inner)')}</div>
                  <div class="form-value">
                   <input type="text" value="{$config['vlan_idc_inner']}" name="vlan_idc_inner" class="edit-icon" placeholder=""/>
                  </div>
                </div>
                <div class="form-item">
                  <div class="form-label">{:lang('Backbone Boundary IP')}</div>
                  <div class="form-value">
                    <input type="text" name="back_idc" value="{$config['back_idc']}"  class="edit-icon" placeholder="0.0.0.0/0"/>
                  </div>
                </div>
                <div class="form-item">
                  <div class="form-label">{:lang('IDC Boundary IP')}</div>
                  <div class="form-value">
                    <input type="text" value="{$config['idc_ip']}" name="idc_ip" class="edit-icon" placeholder="0.0.0.0/0"/>
                  </div>
                </div>
                <div class="form-item">
                  <div class="form-label">{:lang('Backbone ASN')}</div>
                  <div class="form-value">
                    <input type="text" value="{$config['asn_idc']}" name="asn_idc" class="edit-icon" placeholder=""/>
                  </div>
                </div>
                <div class="form-item">
                  <div class="form-label">{:lang('IDC ASN')}</div>
                  <div class="form-value">
                    <input value="{$config['idcasn']}" name="idcasn" class="edit-icon" type="text" placeholder=""/>
                  </div>
                </div>
            </div>
            <!--rigth end-->
            <div style="text-align: center;"><button type="button" class="layui-btn layui-btn-normal layui-btn-sm" id="_saveForm">{:lang('Save')}</button></div>
            </form>
        </div>
        <?php endif;?>
        <!--对接信息 end-->
        <?php if($adminType == 1 || $adminType == 4):?>
        <!--分配工程师-->
        <div class="view-tab" id="view-tab-5" style="display: none">
          <div class="layui-col-xs12" style="margin-top:15px;">
             <table class="mylayui-table">
              <thead>
                <tr>
                  <th>{:lang('Engineer')}</th>
                  <th>{:lang('Type')}</th>
                  <th>{:lang('Distribution Time')}</th>
                  <th>{:lang('Feedback Content')}</th>
                  
                  <th>{:lang('Feedback Time')}</th>
                  <th>{:lang('Status')}</th>
                  <th></th>
                </tr> 
              </thead>
              <tbody>
                <?php if($backeens):?>
                  <?php foreach($backeens as $ed):?>
                <tr>
                  <td>{$ed['username']}</td>
                  <td>
                    <?php if($ed['state']==8): ?>
                    {:lang('Line Adjustment')}
                    <?php elseif($ed['state']==10): ?>
                     {:lang('delete')}
                    <?php else:?>
                    {:lang('Open')}
                    <?php endif;?>
                </td>
                  <td>{$ed['create_time']|date="Y-m-d H:i",###}</td>
                  <td>{$ed['content']|default="--"}</td>

                  <td>{:empty($ed['update_time']) ? '--' : date('Y-m-d H:i',$ed['update_time'])}</td>
                  <td>
                    <?php if($ed['status']==2): ?>
                    {:lang('_Agree_')}
                    <?php elseif($ed['status']==3): ?>
                     {:lang('_Reject_')}
                    <?php else:?>
                     --
                    <?php endif;?>
                </td>
                  <td align="right">
                    <?php if($ed['is_update'] == 1 || $adminType == 4):?>
                        <a  disabled="true" >{:lang('Change')}</a>
                    <?php else:?>
                        <a class=" fenpeiex" data-href="{:U('ajax/updateEng',array('id'=>$ed['id']))}">{:lang('Change')}</a>
                    <?php endif;?>
                  </td>
                </tr>
                <?php endforeach;?>
              <?php else: ?>
                 <tr>
                  <td colspan="6" align="center">{:lang('No Data...')}</td>
                </tr>
              <?php endif;?>
               
              </tbody>
            </table>
          </div>
        </div>
        <!--分配工程师 end -->
        <?php endif;?>
      </div>
      
      
  </div>
  
</div>
<div style="position: fixed;bottom:15px;right: 20px;font-size: 18px;"><b>{$row['broadband']} Mbps
            <?php if($row['status'] == 8 && $row['broadband'] < $row['mbs']):?>
              <i class="icon icon-move-up" style="color: #555;font-size: 18px;"></i> <span style="color: #888;">{$row['mbs']} Mbps</span>
            <?php endif;?>
            <?php if($row['status'] == 8 && $row['broadband'] > $row['mbs']):?>
              <i class="icon icon-move-down" style="color: #555;font-size: 18px;"></i> <span style="color: #888;">{$row['mbs']} Mbps</span>
            <?php endif;?>
</b>&nbsp;&nbsp;&nbsp;&nbsp;<b style="color: #f00;">{$row['total']} / {:lang('Month')}</b>
<!--ke hu-->
  <?php if($adminType == 10000):?>
    <?php if( ($row['status'] == 1 && $row['is_sn'] == 0 ) || $row['status'] == 4):?>
      <a href="{:url('edit',array('network_id'=>$row['id']))}"  class="layui-btn layui-btn-normal">{:lang('Rewrite')}</a>
    <?php endif;?>
  <?php endif;?>
<!--admin-->
<?php if($adminType == 1):?>
  <?php if(($row['status'] == 1 || $row['status'] == 8)):?>
      <?php if($engStatus == 0):?>
        <button class="layui-btn layui-btn-normal fenpeiex" data-href="{:U('ajax/fenpei',array('nework_id'=>$row['id']))}">{:lang('Distribution Engineer')}</button>
        <button class="layui-btn layui-btn-warm backtask" data-href="{:U('_backtask')}">{:lang('Return')}</button>
      <?php endif;?>
      <?php if($engStatus == 2):?>
        <button class="layui-btn layui-btn-xs admin_agree" data-title="{:lang('Confirm whether route configuration is approved.')}" data-href="{:U('_confirm',array('nework_id'=>$row['id']))}">{:lang('Finish')}</button>
      <?php endif;?>
  <?php endif;?>
  <?php if($row['status'] == 10 ):?>
      <?php if($engStatus == 0 ):?>
<!--      <button class="layui-btn confirm-del layui-btn-xs" data-href="{:U('confirmdel',array('nework_id'=>$row['id']))}">{:lang('Agree Delete')}</button>
 -->     <button class="layui-btn layui-btn-normal fenpeiex" data-href="{:U('ajax/fenpei',array('nework_id'=>$row['id'],'type'=>'delete'))}">{:lang('Distribution Engineer')}</button>
     <button class="layui-btn layui-btn-normal backtask" data-href="{:U('_backdel')}">{:lang('Return')}</button>
     <?php endif;?>
  <?php endif;?>
<?php endif;?>
<!--工程师-->
<?php if($adminType == 5 && $checkEngHasPsiee):?>
    <?php if($row['status'] == 10):?>
    
    <button class="layui-btn  layui-btn-normal _agree"  data-title="{:lang('Please enter Remarks')}" data-href="{:U('ajax/confirmdel',array('network_id'=>$row['id'],'eng_id'=>$checkEngHasPsiee))}">{:lang('Agree Close')}</button>
    <?php else:?>
   <button class="layui-btn layui-btn-normal _agree"  data-title="{:lang('Please enter Remarks')}" data-href="{:U('ajax/kaitong',array('network_id'=>$row['id'],'eng_id'=>$checkEngHasPsiee))}">{:lang('Configuration Finish')}</button>
   <!--是否开启自动开通按钮-->
   <?php if($isAuto == 1):?>
   <button class="layui-btn  _agree"  data-title="{:lang('Automatic opening')}" data-href="{:U('ajax/kaitong',array('network_id'=>$row['id'],'eng_id'=>$checkEngHasPsiee,'isAuto'=>1))}">{:lang('Automatic opening')}</button>
   <?php endif;?>
    <?php endif;?>
    <button class="layui-btn  layui-btn-warm rebackcontent" data-href="{:U('ajax/rebackcontent',array('network_id'=>$row['id'],'status'=>3))}">{:lang('Return')}</button>
<?php endif;?>
</div>
{/block}
{block name="footer"}
<!--分配工程师-->
<script type="text/javascript" id="autoopen_from">
    <form class="layui-form" id="_auto_open_from" action="{:U('ajax/autoopen',array('network_id'=>$row['id'],'eng_id'=>$checkEngHasPsiee))}">
        <input type="hidden" value="{$row['id']}" name="network_id"/>
        <div class="layui-form-item" style="margin-top:25px;padding:0 20px;">
            <div class="layui-input-12">
             <fieldset class="layui-elem-field">
              <legend>Tips</legend>
              <div class="layui-field-box">
                <p>{:lang('自动开通Megaport云端连接')}</p>
              </div>
            </fieldset>
            </div>
        </div>
    </form>
</script>
<script type="text/javascript" id="fenpeiex_from">
    <form class="layui-form" id="engine_form" action="{:U('_confirm')}">
        <input type="hidden" value="{$row['id']}" name="network_id"/>
        <div class="layui-form-item" style="margin-top:25px;padding:0 20px;">
            <div class="layui-input-12">
              <select name="enginee_id" lay-filter="aiha2o" >
                <option value="0">{:lang('Select Engineer')}</option>
                <?php if(is_array($enginees)):?>
                    <?php foreach($enginees as $eng):?>
                        <option value="{$eng['admin_id']}">{$eng['email']}【{$eng['username']}】</option>
                    <?php endforeach;?>
                <?php endif;?>
              </select>
            </div>
        </div>
    </form>
</script>
<!--工程师反馈-->
<script type="text/javascript" id="reback_from_html">
    <form id="reback_forms" action="{:U('ajax/rebackcontent')}">
        <input type="hidden" value="{$checkEngHasPsiee}" name="id"/>
        <input type="hidden" value="{$row['id']}" name="network_id"/>
        <div class="layui-form-item" style="margin-top:25px;padding:0 20px;">
            <div class="layui-input-12">
              <textarea style="min-heigth:80px;" placeholder="{:lang('Please enter the return reasons')}" class="layui-textarea" name="content"></textarea>
            </div>
        </div>
    </form>
</script>
<!--退回需求-->
<script type="text/javascript" id="backtask_from">
    <form class="layui-form" id="_form" action="{:U('_backtask')}">
        <input type="hidden" value="{$row['id']}" name="nework_id"/>
        <div class="layui-form-item" style="margin-top:25px;padding:0 20px;">
           <textarea style="min-heigth:80px;" placeholder="{:lang('Please enter the return reasons')}" class="layui-textarea" name="desc"></textarea>
        </div>
    </form>
</script>

<script type="text/javascript" id="enter-password">
    <form class="layui-form" id="password-form" action="">
        <input type="hidden" value="{$row['id']}" id="pasw_nework_id" name="nework_id"/>
        <div class="layui-form-item" style="margin-top:25px;padding:0 20px;">
           <input type="text" id="_password" name="password"  placeholder="{:lang('Please enter your login password.')}" class="layui-input">
        </div>
    </form>
</script>
<script type="text/javascript" src="__STATIC__/plugins/echart/echarts.min.js"></script>
<script type="text/javascript" src="__STATIC__/plugins/echart/westeros.js"></script>
<script type="text/javascript">
        // 基于准备好的dom，初始化echarts实例
        var myChart = echarts.init(document.getElementById('_main'),'westeros');
        // 指定图表的配置项和数据
       
    </script>
  <script>
  
  layui.use(['form', 'layer','laydate','upload'], function () {
      var form = layui.form, layer = layui.layer,$= layui.jquery,laydate = layui.laydate,upload = layui.upload;
      $('input[data-type="1"]').addClass('edit-icon');
      //日期
      laydate.render({
          elem: '#_approtime',
          lang: 'en',
          done: function(value, date){
            actionFieldAjax($('#_approtime'));
          }
      });
      laydate.render({
          elem: '#_enddate',
          lang: 'en',
          done: function(value, date){
            actionFieldAjax($('#_enddate'));
          }
      });
      $(".tab-btn").find("button").click(function(){
         var _this = $(this);
         _this.parent().find("button").removeClass('tab-active');
         _this.addClass('tab-active');
         var _aid = _this.data('id');
         $(".view-tab").hide();
         $(_aid).show();
         if(_aid == '#view-tab-6'){
             // var loading = layer.load(1,{shade:[0.1,'#fff']});
              _reloadChart(myChart,_this,12);
         }
      })
      form.on("select(_hours)",function(obj){
          _reloadChart(myChart,$("#_reloadchart"),obj.value);
      })
      /*监听状态切换*/
      $("body").on('change',"#_status",function(){
        var _this = $(this);
         if(!confirm("{:lang('Confirm changed status?')}")){
           return false;
          }
          var loading = layer.load(1,{shade:[0.1,'#fff']});
          _post("{:url('Ajax/updateField',['nework_id'=>$row['id']])}",{field:'status',value:_this.val()},function(res){
              layer.close(loading);
              if(res.code==1){
                
              }else{
                layer.msg(res.msg, {time: 1800, icon: 2});
              }
          })
      })
      /*放大图片*/
          $('body').on("click","#_image-full",function(){
            var _this = $(this);
            layer.closeAll()
            var srcs  = {
              status:1,
              data:[{src:_this.attr('src'),thumb:''}]
            }
            layer.photos({
              photos:srcs//格式见API文档手册页
              ,shade:false
              ,closeBtn:true
              ,anim: 0 //0-6的选择，指定弹出图片动画类型，默认随机
            });
            
          })
        var loading = null;
        var uploadInst = upload.render({
            elem: '#_mediaBtn'
            ,url: '{:url("api/upload/expand",array('network_id'=>$row['id']))}'
            ,data:{network_id:1}
            ,before: function(obj){
                //预读本地文件示例，不支持ie8
                loading =layer.load(1, {shade: [0.1,'#fff']});
            }
            ,done: function(res){
                layer.close(loading);  
                //上传成功
                if(res.code == 0){
                    $('#_media').val(res.url);
                    $("#_media_view").remove();
                    $('#_media').parent().parent().append('<p id="_media_view"><img src="'+res.url+'" class="view-img0" /></p>')
                }else{
                    //如果上传失败
                    return layer.msg("{:lang('Upload failure')}");
                }
            }
            ,error: function(){
                layer.close(loading);  
                //演示失败状态，并实现重传
                return layer.msg("{:lang('Upload failure')}");
            }
        });
        /**/
      $("body").on("click",'#_saveForm', function (data) {
          loading = layer.load(1,{shade:[0.1,'#fff']});
          // 提交到方法 默认为本身
          //data.field.id = $scope.field.id;
          $.post($("#_form2").attr('action'), $("#_form2").serialize(), function (res) {
              layer.close(loading);
              if (res.code > 0) {
                  layer.msg(res.msg, {time: 1800, icon: 1}, function () {
                      //location.reload();
                  });
              } else {
                  layer.msg(res.msg, {time: 1800, icon: 2});
              }
          });
          return false;
      }); 
      /*工程师确认完成配置*/
      $("._agree").click(function(){
        
         var _this = $(this)
         var _confirm = layer.prompt({
            formType: 2,
            title: _this.data('title'),
            area: ['300px', '50px'],
            btn: "{:lang('Confirm')}",                
           },
         function(value, index, elem){
            var _form = $("#_form");
            loading = layer.load(1,{shade:[0.1,'#fff']});
             _post(_this.data('href'),{content:value},function(res){
                layer.close(loading)
                if(res.code == 1 && res.isopen == 1){
                  layer.close(_confirm)
                  var openingmodel = layer.open({
                      type: 1,
                      title: "{:lang('Automatic opening')}",
                      content:$("#autoopen_from").html(),
                      area: ['450px', '250px'],
                      btn: ["{:lang('Opening')}","{:lang('Not Open')}"],
                      yes:function(index, layero){
                        loading = layer.msg("{:lang('Being opened...')}",{
                           icon: 16
                          ,shade: 0.01,
                          time:1800000,
                        });
                         _post($("#_auto_open_from").attr('action'),{},function(res){
                          layer.close(loading)
                            if(res.code == 1){
                                layer.close(openingmodel)
                                
                                layer.msg(res.msg, {time: 1000, icon: 1},function(){
                                  location.reload();
                                });
                            }else{
                                layer.msg(res.msg, {time: 1800, icon: 2});
                            }
                         })
                      },
                   })
                  return false
                }
                if(res.code == 1){
                    layer.msg(res.msg, {time: 1800, icon: 1},function(){
                    location.reload();
                  });
                }else{
                    layer.msg(res.msg, {time: 1800, icon: 2});
                }
             })
         })
      });
      /*管理员确认开通*/
      $(".admin_agree").click(function(){
         var _this = $(this)
         var _confirm = layer.confirm(_this.data('title'),function(){
            var _form = $("#_form");
            loading = layer.load(1,{shade:[0.1,'#fff']});
             _post(_this.data('href'),{},function(res){
                layer.close(loading)
                if(res.code == 1){
                   layer.msg(res.msg, {time: 1800, icon: 1},function(){
                    location.reload();
                  });
                }else{
                    layer.msg(res.msg, {time: 1800, icon: 2});
                }
             })
         })
      });
       /*需求退回*/
        $(".backtask").click(function(){
          var _this = $(this);
            layer.open({
            type: 1
            ,id: 'layerDemo2' //防止重复弹出
            ,title:"{:lang('Auditing')}"
            ,area: ['600px', '400px']
            ,content: $("#backtask_from").html()
            ,btn: "{:lang('Return')}"
            ,btnAlign: 'r' //按钮居中
            ,shade: 0 //不显示遮罩
            ,yes: function(){
                 var _form = $("#_form");
                 loading = layer.load(1,{shade:[0.1,'#fff']});
                 _post(_this.data('href'),_form.serialize(),function(res){
                    layer.close(loading)
                    if(res.code == 1){
                        layer.msg(res.msg, {time: 1800, icon: 1},function(){
                          location.reload();
                        });
                    }else{
                        layer.msg(res.msg, {time: 1800, icon: 2});
                    }
                 })
            }
          });
        })
        /*确认删除*/
        $(".confirm-del").click(function(){
          var _this = $(this)
          var confirm = layer.confirm('{:lang("Is it sure to delete the line?")}',function(){
            layer.close(confirm);
              loading = layer.load(1,{shade:[0.1,'#fff']});
              _post(_this.data('href'),{},function(res){
                  layer.close(loading)
                  if(res.code == 1){
                      layer.msg(res.msg, {time: 1800, icon: 1},function(){
                        location.reload();
                      });
                      
                  }else{
                      layer.msg(res.msg, {time: 1800, icon: 2});
                  }
               })
          })
        })
        /*显示输入密码狂*/
        $('.show-password').click(function(){
            var _this= $(this);
            if(_this.hasClass("layui-btn-disabled")){
                return false;
            }
           var showodel = layer.open({
              type: 1//此处以iframe举例
              ,title: _this.text()
              ,area: ['600px', '400px']
              ,shade: 0.8
              ,btn: ["{:lang('Confirm')}"] //只是为了演示
              ,content: $("#enter-password").html()
              ,zIndex: layer.zIndex //重点1
              ,yes: function(){
                loading = layer.load(1,{shade:[0.1,'#fff']});
                _post("{:U('ajax/checkPassword')}",{aid:_this.data('aid'),network_id:$("#pasw_nework_id").val(),password:$("#_password").val()},function(res){
                    layer.close(loading);
                    if(res.code == 1){
                         layer.close(showodel);
                        $(".access_id_"+res.data.aid).text(res.data.accessID)
                        $(".secrect_key_"+res.data.aid).text(res.data.secrectKey)
                        _this.addClass("layui-btn-disabled");
                    }else{
                      layer.msg(res.msg, {time: 1800, icon: 2});
                    }
                })
              }
            })
        })
        /*分配工程师*/
          $('.fenpeiex').click(function(){
              var _this= $(this);
              if(_this.hasClass("layui-btn-disabled")){
                  return false;
              }
             var showodel = layer.open({
                type: 1//此处以iframe举例
                ,title: "{:lang('Distribution Engineer')}"
                ,area: ['600px', '450px']
                ,shade: 0
                ,btn: ["{:lang('Confirm')}"] //只是为了演示
                ,content: $("#fenpeiex_from").html()
                ,zIndex: layer.zIndex //重点1
                ,yes: function(){
                  var loading = layer.load(1,{shade:[0.1,'#fff']});
                  _post(_this.data('href'),$("#engine_form").serialize(),function(res){
                      layer.close(loading);
                      if(res.code == 1){
                          layer.msg(res.msg, {time: 1800, icon: 1},function(){
                            location.reload();
                          });
                           layer.close(showodel);
                          _this.addClass("layui-btn-disabled");
                      }else{
                        layer.msg(res.msg, {time: 1800, icon: 2});
                      }
                  })
                }
              })
             form.render()
          })
          /*工程师反馈*/
          $('.rebackcontent').click(function(){
              var _this= $(this);
              if(_this.hasClass("layui-btn-disabled")){
                  return false;
              }
              var _url = _this.data('href')
             var showodel = layer.open({
                type: 1//此处以iframe举例
                ,title: _this.text()
                ,area: ['600px', '400px']
                ,shade: 0
                ,btn: ["{:lang('Confirm')}"] //只是为了演示
                ,content: $("#reback_from_html").html()
                ,zIndex: layer.zIndex //重点1
                ,yes: function(){
                  loading = layer.load(1,{shade:[0.1,'#fff']});
                  _post(_url,$("#reback_forms").serialize(),function(res){
                      layer.close(loading);
                      if(res.code == 1){
                           layer.msg(res.msg, {time: 1800, icon: 1},function(){
                            location.reload();
                           });
                          _this.addClass("layui-btn-disabled");
                      }else{
                        layer.msg(res.msg, {time: 1800, icon: 2});
                      }
                  })
                }
              })
          })

      setSlideMb();
  })
  
  </script>
{/block}